package com.itttq.gen.common.constant;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.baomidou.mybatisplus.core.enums.IEnum;
import com.fasterxml.jackson.annotation.JsonValue;

public class StatusTypeEnums {
    public enum StatusEnums implements IEnum<Integer> {
        /**
         * 状态
         */
        ENABLE(1, "启用"), DISABLE(2, "禁用"), DELETE(9, "已删除");

        private final String alias;
        @JsonValue
        @EnumValue
        private final int code;

        StatusEnums(int code, String alias) {
            this.code = code;
            this.alias = alias;
        }

        public int getCode() {
            return code;
        }

        public String getAlias() {
            return alias;
        }

        @Override
        public Integer getValue() {
            return code;
        }
    }

    /**
     * 模型来源类型：1-数据库；2-SQL文件；3-SQL语句
     */
    public enum SourceTypeEnums implements IEnum<Integer> {
        /**
         * 状态
         */
        DB(1, "数据库"), SQL_FILE(2, "SQL文件"), SQL(3, "SQL语句");

        private final String alias;
        @JsonValue
        @EnumValue
        private final int code;

        SourceTypeEnums(int code, String alias) {
            this.code = code;
            this.alias = alias;
        }

        public int getCode() {
            return code;
        }

        public String getAlias() {
            return alias;
        }

        @Override
        public Integer getValue() {
            return code;
        }
    }
}
